/*
 * DisplayRectangle.java
 * Created on December 20, 2007, 2:44 AM by Uru
 *
 * Holds data for a rectangle primitive
 */

package MenuSystem;

import java.awt.*;
import javax.swing.*;

public class DisplayRectangle implements SelfDrawing{
    protected int width;
    protected int height;
    protected boolean fill;
    Color color;
    
    //Creates a new instance of DisplayRectangle
    public DisplayRectangle(int w, int h, boolean f, Color c){
        width = w;
        height = h;
        fill = f;
        color = c;
    }
    
    //draws the rectangle
    public void draw(Graphics2D g, int mx, int my, JComponent screen){
        g.setColor(color);
        if(fill)g.fillRect(mx,my,width,height);
        else g.drawRect(mx,my,width,height);
    }
    
}
